﻿Class MainWindow 
  Private Sub btnAggiungi_Click(
      ByVal sender As System.Object,
      ByVal e As  _
        System.Windows.RoutedEventArgs) _
      Handles btnAggiungi.Click
    ListBox1.Items.Add(TextBox1.Text)
  End Sub

  Private Sub btnCancella_Click(
      ByVal sender As System.Object,
      ByVal e As  _
        System.Windows.RoutedEventArgs) _
      Handles btnCancella.Click
    ListBox1.Items.RemoveAt(
      ListBox1.Items.IndexOf(
        ListBox1.SelectedItem))
  End Sub

  Private Sub btnLeggi_Click(
      ByVal sender As System.Object,
      ByVal e As  _
        System.Windows.RoutedEventArgs) _
      Handles btnLeggi.Click
    Me.TextBox1.Text =
      Me.ListBox1.SelectedValue.ToString
  End Sub
End Class
